# Contributor: Chleba <chlebik@gmail.com>
# Maintainer: Chleba <chlebik@gmail.com>
pkgname=netscanner
pkgver=0.4.4
pkgrel=0
pkgdesc="Network scanning tool"
url="https://github.com/Chleba/netscanner"
# s390x, ppc64le, riscv64: not supported
arch="all !s390x !ppc64le !riscv64"
license="MIT"
makedepends="cargo cargo-auditable"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Chleba/netscanner/archive/v$pkgver.tar.gz"
options="net"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
	install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
	install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

sha512sums="
03e72d38d303626edbdcdd640deaf8a19638716cb3e7d45735e77f4b09f93d4a5333bc152a256bd2e1a95615e853463707ad1157c8182b972a1b79e39bd0c09b  netscanner-0.4.4.tar.gz
"
